-- GENERATED SPELL FOR [Crimson Hand Blood Knight] --


function spell0_20049(pUnit, Event) --@Cleanse,n/a--
pUnit:FullCastSpellOnTarget(39078,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20049', 585, 1)
end

function spell1_20049(pUnit, Event) --@Flash of Light,Heal--
pUnit:FullCastSpellOnTarget(37257,pUnit)
pUnit:RegisterEvent('Sorts_20049', 1000, 1)
end

function spell2_20049(pUnit, Event) --@Hammer of Justice,n/a--
pUnit:FullCastSpellOnTarget(39077,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20049', 6285, 1)
end

function spell3_20049(pUnit, Event) --@Hammer of Wrath,n/a--
pUnit:FullCastSpellOnTarget(37259,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20049', 500, 1)
end

function spell4_20049(pUnit, Event) --@Renew,Heal--
pUnit:FullCastSpellOnTarget(37260,pUnit)
pUnit:RegisterEvent('Sorts_20049', 15000, 1)
end

function Sorts_20049(pUnit, Event)
local choix_sorts_20049 = math.random(0, 4)
if choix_sorts_20049 == 0 then
pUnit:RegisterEvent('spell0_20049', 1, 1)
end
if choix_sorts_20049 == 1 then
pUnit:RegisterEvent('spell1_20049', 1, 1)
end
if choix_sorts_20049 == 2 then
pUnit:RegisterEvent('spell2_20049', 1, 1)
end
if choix_sorts_20049 == 3 then
pUnit:RegisterEvent('spell3_20049', 1, 1)
end
if choix_sorts_20049 == 4 then
pUnit:RegisterEvent('spell4_20049', 1, 1)
end
end

function mob20049_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20049', math.random(1500, 3000), 1)
end

function mob20049_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20049_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20049_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20049, 1, 'mob20049_Action')
RegisterUnitEvent(20049, 2, 'mob20049_Leave')
RegisterUnitEvent(20049, 3, 'mob20049_Kill')
RegisterUnitEvent(20049, 4, 'mob20049_Die')
